#include "processor.hpp"

#include "protocol_all.hpp"
#include "protocol_parser.hpp"
#include "acceptor_manager.hpp"

using namespace protocol;

extern AcceptorManager * g_acceptor_manager;

IMPL_LOGGER(Processor, logger);

void Processor::process_message(Connection & conn, void * data)
{
	ProtocolExampleReq * protocol = (ProtocolExampleReq*)data;

	LOG4CPLUS_DEBUG(logger, "datagram: " << protocol->to_string());

	protocol->_name = "Test";

	g_acceptor_manager->send_data(conn, protocol);
	
	LOG4CPLUS_DEBUG(logger, "response: " << protocol->to_string());
}

